﻿@{
    Layout = "~/_SiteLayout.cshtml";
    Page.Title = "New Cash Card App";

	var custStatus = RefDataManager.GetCustStatLkUpVal();
    var custClass = RefDataManager.GetCustClassLkUpVal();
    var custCountry = RefDataManager.GetCountryValuesByRegion("EU");
    var custGender = RefDataManager.GetGenderLkUpVal();
    var custNationality = RefDataManager.GetNatLkUpVal();
    var custIdType = RefDataManager.GetIDTypeLkUpVal();
    var custSourceFund = RefDataManager.GetSrcOfFundsLkUpVal();
    var custEmpType = RefDataManager.GetEmpTypeLkUpVal();
    var ccStatus = RefDataManager.GetCashCardStatLkUpVal();
    var ccDocStatus = RefDataManager.GetDocStatLkUpVal();
    var ccType = RefDataManager.GetCashCardTypeLkUpVal();
    var ccPartnerBank = RefDataManager.GetPartnerBankLkUpVal();
    var ccDelStatus = RefDataManager.GetCardDelLkUpVal();
    var ccCustomer = CustomerManager.GetCustomer(Request["custId"]);
    var customerId=Request["custId"];
    DateTime cdate = DateTime.Now;
}

<script>

 $(document).ready(function(){
     wireEvents();    
});

function wireEvents(){
    //datepicker
    $("#datepicker").datepicker({
          changeMonth:true,
          changeYear:true,
          showButtonPanel:true,
          yearRange:'-100:+0',
          minDate: new Date(1950,1-1,1),
          maxDate: new Date(2012,12-1,31)
        }); 
        
   //dialog box
     $("#dialog").dialog({
         autoOpen:false,
         modal:true,
         resizable:false,
         draggable:false,
         position:"center",
         buttons:{
             "Yes, I do":function(){
                     
                     $("#custForm").submit();
                   },
             "No":function(){
                     $("#dialog").dialog("close");
                     $("#custForm").preventDefault();
            }
        }
        });
    ///  
     //save button  
      $("#addCustomer").click(function(){
           $("#dialog").dialog("open");
            $("#saveOption").val("save");
       });
      //apply cashcard button
      $("#applyCC").click(function(){
       
        $("#dialog").dialog("open");
        $("#saveOption").val("applyCC");
     });
     //edit button
     $("#edit").click(function(){
         $('#tabs :input').removeAttr('disabled');
    });
    
    //Fill the customer drop down
      GetLookUp('region','country','country');    
      GetLookUp('region','currMailCountry','country');
      GetLookUp('region','permAddCountry','country');
      GetLookUp('region','busAddCountry','country');
      GetLookUp('country','curState','state');
      GetLookUp('country','permAddState','state');
      GetLookUp('country','busAddState','state');
    
}
    
    
</script>


    
<form method="post" name="ccApp">
     <input type="hidden" name="custId" value="@customerId"/>
    <div id="tabs">
        <ul>
            <li ><a href="#tab1">Customer Details</a></li>
            <li ><a href="#tab2">Cash Card Details</a></li>
        </ul>
     <div id="tab1">
         <label>CUSTOMER:</label><label>@customerId</label><br />
            
       <label> CUSTOMER STATUS:</label> <select name="status">
            @foreach(var status in custStatus){
                foreach(var strCusStat in ccCustomer){
                    if (status.RefID.Equals(strCusStat.CustomerStatus)){
                        <option value="@status.RefID" selected="selected">@status.RefDesc</option>}
                    else{
                        <option value="@status.RefID">@status.RefDesc</option>}
                    }
                    
			}
        </select> *
        <br />
        <label>CUSTOMER CLASSIFICATION:</label> <select name="classification">
            @foreach(var classification in custClass){
                foreach(var strClass in ccCustomer){
                    if (classification.RefID.Equals(strClass.CustomerClassification)){
                        <option value="@classification.RefID" selected="selected">@classification.RefDesc</option>}
                    else{
                        <option value="@classification.RefID">@classification.RefDesc</option>}
                }
            }
        </select> *
        <br />
        <label>COUNTRY:</label><select name="country">
           @foreach(var country in custCountry){
                foreach(var strCtry in ccCustomer){
                    if (country.RefID.Equals(strCtry.Country)){
                        <option value="@country.RefID">@country.RefDesc</option>}
                }
            }
        </select> * 
        <br />
        <label>GENDER:</label> 
                @foreach(var gender in custGender){
                    <input type="radio" name="sex" value=@gender.RefID /> @gender.RefDesc
            }
         *<br />
        <label>NATIONALITY:</label> <select name="nationality">
            @foreach(var nationality in custNationality){
                if (nationality.RefID.Equals("PH")){
                    <option value="@nationality.RefID" selected="selected">@nationality.RefDesc</option>}
                else{
                    <option value="@nationality.RefID">@nationality.RefDesc</option>}
            }
        </select> *
        <br />
        <label>BIRTHDAY:</label> 
        @foreach(var bdate in ccCustomer){
            <input type="Text" name="bdate" id="datepicker" value="@bdate.Bdate"/>}
        <br />
        <label>PLACE OF BIRTH:</label> 
        @foreach(var bplace in ccCustomer){
            <input type="text" name="birthplace" value="@bplace.PlaceOfBirth"></input>}
        <br />
        <label>ID PRESENTED:</label> <select name="idtype">
            @foreach(var idtype in custIdType){
                <option value="@idtype.RefID">@idtype.RefDesc</option>
            }            
        </select>
        <input type="text" name="idno"></input> (ID Type & ID Number)<br />
        <label>SOURCE OF FUNDS:</label> <br />
            @foreach(var sourcefund in custSourceFund){
                <input type="checkbox" name="funds" value=@sourcefund.RefID/> @sourcefund.RefDesc<br />
            }
        <label>EMPLOYMENT:</label> <br />
            @foreach(var empType in custEmpType){
                <input type="checkbox" name="empType" value=@empType.RefID/> @empType.RefDesc<br />
            }
        <label>EMPLOYER / BUSINESS NAME:</label> 
        @foreach(var bizname in ccCustomer){<input type="text" name="employer" value="@bizname.Employer"></input>}
        <br />
        <label>NATURE OF WORK / BUSINESS:</label> 
        @foreach(var nature in ccCustomer){<input type="text" name="natureBiz" value="@nature.NatureOfWork"></input>}
        <br />                    
        </fieldset>
        
        <br />
    </div>
       <div id="tab2">
        <label>CASH CARD APPLICATION NO.:</label> <label>@Page.CCID</label>
        <label>APPLICATION DATE:</label>
        <input type="Text" name="appDate" value="" id="datepicker" >
        <br />
        <label>CASH CARD STATUS:</label> <select name="cashStatus">
            @foreach(var cStatus in ccStatus){
                if (cStatus.RefID.Equals("PEN")){
                    <option value=@cStatus.RefID selected="selected">@cStatus.RefDesc</option>}
                else{
                    <option value=@cStatus.RefID>@cStatus.RefDesc</option>}
            }            
        </select>
        <input type="text" name="txtCcStatus"></input>
        <br />
        <label>CASH CARD STATUS DATE:</label>
        <input type="Text" name="ccStatusDate" value="" id="datepicker">
        <img src="cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a>
        <br />
        <label>DOCUMENT STATUS:</label> <select name="docStatus">
            @foreach(var cDocStatus in ccDocStatus){
                if (cDocStatus.RefID.Equals("INC")){
                <option value=@cDocStatus.RefID selected="selected">@cDocStatus.RefDesc</option>}
                else{
                    <option value=@cDocStatus.RefID>@cDocStatus.RefDesc</option>}
            }            
        </select>
        <input type="text" name="txtCcDocStatus"></input>
        <br />
        <label>CASH CARD NO:</label> <input type="text" name="txtCcNo"></input><br />
        <label>CASH CARD TYPE:</label> <select name="cardType">
            @foreach(var cType in ccType){
                if (cType.RefID.Equals("PER")){
                    <option value=@cType.RefID selected="selected">@cType.RefDesc</option>}
                else{
                    <option value=@cType.RefID>@cType.RefDesc</option>}
            }            
        </select>
        <br />
        <label>PARTNER BANK:</label> <select name="partnerBnk">
            @foreach(var cPartenerBnk in ccPartnerBank){
                if (cPartenerBnk.RefID.Equals("CT")){
                    <option value=@cPartenerBnk.RefID selected="selected">@cPartenerBnk.RefDesc</option>}
                else{
                    <option value=@cPartenerBnk.RefID>@cPartenerBnk.RefDesc</option>}
            }            
        </select>
        <br />
        <label>STATUS DATE:</label>
        <input type="Text" name="txtStatusDate" value="" id="datepicker">
        <br />      
        <label>NAME ON CARD: </label><input type="text" name="txtName"></input><br />         
        <label>CARD EXPIRY DATE:</label> <input type="text" name="txtExpDate" id="datepicker"></input>
        <img src="cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a>    
        <br />
        <label>CARD DELIVERY STATUS:</label> <select name="delStatus">
            @foreach(var cDelStatus in ccDelStatus){
                if (cDelStatus.RefID.Equals("PEN")){
                    <option value=@cDelStatus.RefID selected="selected">@cDelStatus.RefDesc</option>}
                else{
                    <option value=@cDelStatus.RefID>@cDelStatus.RefDesc</option>}
            }            
        </select>
        <br />
        <label>DELIVERY STATUS DATE:</label> <input type="text" name="txtDelStatusDate" id="datepicker">    
        <br />
        <label>REMARKS:</label> <textarea name="remarks"></textarea>
        <br />
        <label>CARD DELIVERY COURIER:</label> <input type="text" name="Courier"></input>
        <br />
        <label>DELIVERY DATE:</label> <input type="text" name="DelDate" id="datepicker"></input>
      
    </form>
    </div>
        </div>
      <div id="buttons" align="center">
       <input type="button" id="addCustomer"  value="SAVE"/>
     
        
        </div> 
      
    
